package com.jp.fm.dao;

import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import net.sf.ehcache.event.CacheEventListener;

public class AccountCacheListener implements CacheEventListener {

	@Override
	public void dispose() {
		// Not implemented
	}

	@Override
	public void notifyElementEvicted(final Ehcache arg0, final Element arg1) {
		// Not implemented
	}

	@Override
	public void notifyElementExpired(final Ehcache arg0, final Element arg1) {
		// Not implemented
	}

	@Override
	public void notifyElementPut(final Ehcache arg0, final Element arg1) {
		// Not implemented
	}

	@Override
	public void notifyElementRemoved(final Ehcache arg0, final Element arg1) {
		// Not implemented
	}

	@Override
	public void notifyElementUpdated(final Ehcache arg0, final Element arg1) {
		// Not implemented

	}

	@Override
	public final void notifyRemoveAll(final Ehcache arg0) {
		System.out.println("Account cache cleared...reloading");
		new AccountDao().findAll();

	}

	@Override
	public final Object clone() throws CloneNotSupportedException {

		return super.clone();
	}
}
